home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / glibc108.gz / glibc108 / glibc-1.08.1 / manual / examples / strncat.c < prev    next >
C/C++ Source or Header  |  1994-02-16  |  224b  |  15 lines

  1. #include <string.h>
  2. #include <stdio.h>
  3.  
  4. #define SIZE 10
  5.  
  6. static char buffer[SIZE];
  7.  
  8. main ()
  9. {
  10.   strncpy (buffer, "hello", SIZE);
  11.   puts (buffer);
  12.   strncat (buffer, ", world", SIZE - strlen (buffer) - 1);
  13.   puts (buffer);
  14. }
  15.